package com.hehao.java_basic.design_mode.behaviour.chain_of_responsibility.demo;

import com.hehao.common.Enum.RequestType;
import com.hehao.common.entiy.Request;

public class ConcreteHandler2 extends Handler{
    public ConcreteHandler2(Handler successor) {
        super(successor);
    }

    @Override
    protected void handleRequest(Request request) {
        if (request.getType() == RequestType.type2) {
            System.out.println(request.getName() + " is handle by ConcreteHandler2");
            return;
        }
        if (successor != null) {
            successor.handleRequest(request);
        }
    }
}